/**
 * Project: springyounger.lottery.dal
 * 
 * File Created at 2010-3-27
 * $Id$
 * 
 * Copyright 2009 Zjut Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Zjut Edu. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Zjut Edu.
 */
package com.springyounger.lottery.dal.dao;

import java.util.List;

import com.springyounger.lottery.dal.dataobject.LotteryPhaseQuestion;
import com.springyounger.lottery.dal.dataobject.LotteryQuestion;
import com.springyounger.lottery.dal.dataobject.LotteryQuestionResult;

/**
 * TODO Comment of QuestionDao
 * 
 * @author springyounger
 */
public interface QuestionDao {
    LotteryPhaseQuestion getPhaseQuestion(LotteryPhaseQuestion question);

    List<LotteryQuestionResult> getQuestionResult(int questionId);

    LotteryQuestionResult getQuestionResultByResultId(int resultId);

    LotteryPhaseQuestion getPhaseQuestion(int questionId,int phaseId);

    int getAllQuestionCount();

    List<LotteryQuestion> getAllQuestion(int pageIndex, int pageSize);

    int updateQuestion(LotteryQuestion question);

    int deleteQuestionById(int questionId);

    LotteryQuestion getQuestionById(int questionId);

    String getResultById(int questionId);

    LotteryQuestion insertQuestion(LotteryQuestion question);

    int updateQuestionResult(LotteryQuestionResult questionResult);

    void batchInsertQuestionResult(final List<LotteryQuestionResult> resultList,
                                   final int questionId);

    int isExistName(String content);

    void batchUpdateQuestionResult(final List<LotteryQuestionResult> resultList,
                                   final int questionId);

    /**
     * 批量创建活动题目
     * 
     * @param phaseQuestionList
     */
    void batchInsertPhaseQuestion(final List<LotteryPhaseQuestion> phaseQuestionList);

    int getAllQuestionCountByType(String questionType);

    List<LotteryQuestion> getAllQuestionByType(String questionType);

    int getPhaseQuestionCount(int phaseId);

    List<LotteryPhaseQuestion> getAllPhaseQuestion(int phaseId, int pageIndex, int pageSize);
}
